<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <title>React Cli</title>
</head>
<body>
  <div id="app"></div>
  <div class='triangle'></div>
</body>
<script>
  var triangle = document.querySelector('.triangle');
  // 补全代码
  // let element = ''
  // for(let i = 1;i<=3;i++) {
  //     for(let j = 0;j<=i;j++) {
  //         element += '*'
  //     }
  //     element += '<br />'
  // }
  // triangle.innerHTML = element
  const content = new Array(3).fill('').map((item, key) => '*'.repeat(key + 1)).join('<br />')
  console.log(content)
  triangle.innerHTML = content
</script>
</html>